# -*- coding: utf-8 -*-
# @Time : 2022/2/25 12:51
# @File : forms.py

from django import forms
from django.forms import widgets

from . import models


class LoginForm(forms.Form):
    username = forms.CharField(widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'username'}),
                               max_length=16)
    password = forms.CharField(widget=widgets.PasswordInput(attrs={'class': 'form-control', 'placeholder': 'password'}),
                               max_length=16)
    verifycode = forms.CharField(
        widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'verify code'}),
        max_length=5)


class RigisterForm(forms.Form):
    verifycode = forms.CharField(
        widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'verify code'}),
        max_length=5)

    username = forms.CharField(widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'username'}),
                               max_length=16)
    password = forms.CharField(widget=widgets.PasswordInput(attrs={'class': 'form-control', 'placeholder': 'password'}),
                               max_length=16)

    tel = forms.CharField(widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'tel'}),
                          max_length=11)

    name = forms.CharField(widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'name'}),
                           max_length=10)
    driving_license_type = forms.CharField(
        widget=forms.Select(choices=(('c1', 'c1 driving license'), ('c2', 'c2 driving license')),
                            attrs={'class': 'form-control'}))
    age = forms.CharField(widget=widgets.NumberInput(attrs={'class': 'form-control', 'placeholder': 'age'}))


class SignForm(forms.Form):

    driving_license_type = forms.CharField(
        widget=forms.Select(choices=(('c1', 'c1 driving license(￥3280)'), ('c2', 'c2 driving license(￥3580)')),
                            attrs={'class': 'form-control','style':'margin-top:1%;margin-bottom:1%'}))
